#include "Score.h"
#include <iomanip>
#include <ostream>
using std::setw;

Score::Score() {
}

Score::Score(double sco) {
    setScore(sco);
}

Score::Score(const string &stuid, const string &stuname, const string &courname, double sco) {
    setStudentId(stuid);
    setStudentName(stuname);
    setCourseName(courname);
    setScore(sco);
}

void Score::setStudentId(const string &id) {
    studentid = id;
}

string Score::getStudentId() const {
    return studentid;
}

void Score::setStudentName(const string &name) {
    studentname = name;
}

string Score::getStudentName() const {
    return studentname;
}

void Score::setCourseName(const string &name) {
    coursename = name;
}

string Score::getCourseName() const {
    return coursename;
}

void Score::setScore(double sco) {
    score = sco;
}

double Score::getScore() const {
    return score;
}

ostream &operator<<(ostream &output, const Score &score) {
    output << score.getStudentId() << setw(5) << score.getStudentName() << setw(5)
           << "Course: " << score.getCourseName() << setw(5) << "Score: " << score.getScore() << endl;
    output << endl;

    return output;
}

istream &operator>>(istream &input, Score &score) {
    input >> score.studentid >> score.studentname >> score.coursename >> score.score;
    return input;
}